import unittest

from quote.base.usebrowser import UseBrowser
from quote.web_page.usermanager.login_page import LoginPage


class LoginFailCase(unittest.TestCase):

    def setUp(self):
        self.login_page = LoginPage()

    def test_1_admin_username_pwd_error(self):
        self.login_page.login('admin','888888')
        actual_info=self.login_page.get_fail_info()
        self.assertEqual(actual_info,'请勿非法登录！')

    def test_2_admin_username_null(self):
        self.login_page.login('','888888')
        actual_info=self.login_page.get_fail_info()
        self.assertEqual(actual_info,'请勿非法登录！')

    def test_3_admin_pwd_null(self):
        self.login_page.login('admin','')
        actual_info=self.login_page.get_fail_info()
        self.assertEqual(actual_info,'请勿非法登录！')

    def tearDown(self):
        UseBrowser.quit()

if __name__ == '__main__':
    unittest.main()
